<script lang="ts" setup>
import { useDesignSettingStore } from '@/store/modules/designSetting'
import { computed } from '@vue/reactivity';
import { darkTheme } from 'naive-ui';
import AppProvider from '@/components/AppProvider/AppProvider.vue'
import { onMounted } from 'vue';
const designSettingStore = useDesignSettingStore()

const getDarkTheme = computed(() => designSettingStore.getDarkTheme ? darkTheme : undefined)
onMounted(() => {
  const loadingDom = document.querySelector('.loading-container') as Node
  const app = loadingDom?.parentNode
  app?.removeChild(loadingDom)
})

</script>

<template>
  <NConfigProvider :theme="getDarkTheme">
    <AppProvider>
      <router-view />
    </AppProvider>
  </NConfigProvider>
</template>


<style lang="less">
@import "styles/index.less";
</style>
